package day1

object Test2 {
  def main(args: Array[String]): Unit = {
    // 1、自动类型转换
    var i:Byte = 10
    var j:Short = i
    println(j)
    // 2、强制类型转换
    var a1:Double = 2.5
    var a2:Int = a1.toInt  // 会出现精度丢失
    println(a2)
    // 3、Int和字符串类型之间的转换
    var a5:Int = 10
    var a6:String = a5.toString
    println(a6)

    var a3:String = "yy"
//    var a4:Int = a3.toInt
    println(a3)
  }
}
